<template>
  <div class="dialog">
    <div class="dialog-header">
      <!-- 如果 使用了多个插槽，这是需要给每个插槽起一个名字 -->
      <h3>
        <slot name="title"></slot>
      </h3>
      <span class="close">✖️</span>
    </div>

    <div class="dialog-content">
      <!-- 1.使用slot标签进行占位  (先挖坑) -->
      <!-- 如果设置了默认内容：外面传入了新内容，以新内容为准。如果不传以默认内容为准 -->
      <slot name="content"></slot>
    </div>
    <div class="dialog-footer">
      <slot name="footer"></slot>
    </div>

    <!-- 默认插槽 也有一个名子 default -->
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
}
</script>

<style scoped>
* {
  margin: 0;
  padding: 0;
}
.dialog {
  width: 470px;
  height: 230px;
  padding: 0 25px;
  background-color: #ffffff;
  margin: 40px auto;
  border-radius: 5px;
}
.dialog-header {
  height: 70px;
  line-height: 70px;
  font-size: 20px;
  border-bottom: 1px solid #ccc;
  position: relative;
}
.dialog-header .close {
  position: absolute;
  right: 0px;
  top: 0px;
  cursor: pointer;
}
.dialog-content {
  height: 80px;
  font-size: 18px;
  padding: 15px 0;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
}
.dialog-footer button {
  width: 65px;
  height: 35px;
  background-color: #ffffff;
  border: 1px solid #e1e3e9;
  cursor: pointer;
  outline: none;
  margin-left: 10px;
  border-radius: 3px;
}
.dialog-footer button:last-child {
  background-color: #007acc;
  color: #fff;
}
</style>